<?php
require "../template/header.php";
require "../function/function_user.php";
require "../function/function_racetime.php";

if ($mysqlpass!=$cookiepass){
header("Location:../do.php?type=logints");
}
?>
	<body onload="startTime();">
		<div id="warp">
			<div id="user-header">
				<div id="user-logo">
					<a href="./">
						<img border="0" src="../images/logo.png">
					</a>
				</div>
<?php
require_once "../template/user_info.php";
?>
			</div>
			<div id="user-content">
				<div id="user-content-left">
<?php
require_once "../template/user_menu.php";
?>
				</div>
				<div id="user-content-right">
					<div id="user-content-right-main">
						<div id="user-content-right-main-tou">
							<a href="./">首页</a> > <a href="./">争分夺秒</a>
						</div>
						<div id="user-content-right-main-racetime">
							<div id="user-content-right-main-racetime-title">
								<div id="user-content-right-main-racetime-title-main">
									<h3>玩法介绍↓</h3>
									<p id="racetime-text">
										什么是争分夺秒呢?其实就是比手快,系统每小时会出现一个夺秒时间,等到夺秒时间到后第一秒开抢。
										<br />
										第一个抢到的用户则夺秒成功,其他夺秒者则夺秒失败。若一直未有人抢,则被抢到后才开始下一轮。
									</p>
									<div id="racetime-num">
									抢到次数:<?php echo $userinfo['racetime']; ?>次
									</div>
								</div>
							</div>
							<div id="user-content-right-main-racetime-main">
								<div id="user-content-right-main-racetime-main-box">
									<div id="user-content-right-main-racetime-main-box-racetime">
										夺秒时间:<?php echo date("Y年m月d日 H:i:s",$info_racetime['main']);?>
									</div>
									<div id="user-content-right-main-racetime-main-box-nowtime">
										现在时间:<?php echo date("Y年m月d日",time());?><span id="Racetimes"></span>
									</div>
									<div id="user-content-right-main-racetime-main-box-gong">
										本期奖品:可获得5个挂Q配额
									</div>
									<div id="user-content-right-main-racetime-main-box-result">
										<div id="racetime-result-result">
											返回结果
										</div>
										<div id="racetime-result-main">
											<?php
												if (isset($_POST['racetime'])){
												racetime($info_racetime['main'],$cookieuser,$userinfo['quota'],$userinfo['racetime']);
												}else{
												echo "&nbsp;";
												}
											?>
										</div>
									</div>
									<div id="user-content-right-main-racetime-main-box-link">
										<form action="" method="post">
											<button type="submit" name="racetime">我抢</button>
										</form>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div id="footer">
<?php
require "../template/footer.php";
?>